#ifndef GAMETIME_H
#define GAMETIME_H
#ifdef WIN32
#include "windows.h"
#elif LINUX
#include <sys/time.h>
#endif

#include "StompedReality/Core.h"
namespace StompedReality
{
/*!
 * \brief	Time
 *
 *    Stores the time of running game.
 *
 */
class DLL_EXPORT GameTime
{
 private:

  double _frameStart;
  double _frameRate;
#ifdef WIN32
  LARGE_INTEGER li;
  double _freq;
  __int64 _counterStart;
#elif LINUX
  timeval time;
  double _counterStart;
#endif // ifdef WIN32

 public:

  //! \brief	Constructor.
  //!
  //! Creates an instance of GameTime.<br>
  //! The initial time stamp is is 0.
  //!
  GameTime( );

  //! Destructor.
  ~GameTime( );

  //! \brief  Time update.
  //!			This function updates the time stamp.
  void updateTime( );

  //! \brief  Time reset.
  //!			This function resets the time stamp to 0.
  void resetTime( );

  //! \brief	Duration of last update call.
  //!			This function returns the last update call's duration.
  //!
  //! \return	last update time.
  const double lastUpdateTime( );

  //! \brief	Time since last update call
  //!			This function returns the time since the current update call.
  //!
  //! \return	frame time.
  const double frameTime( );

  //! \brief	Total game time
  //!			This function returns the total game time.
  //!
  //! \return	total game time.
  const double totalTime( );
};

}
#endif // ifndef GAMETIME_H
